<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            border: solid black 2px;
            width: 250px;
            height: 250px;
        }

        span {
            position: relative;
            right: -5em;
            top: 5em;
        }

        .c {
            position: absolute;
            left: 25em;
            top: 1em;
        }

        .f {
            position: fixed;
            right: 1em;
            top: 1em;
        }
    </style>
</head>

<body>
    <div><span>相对定位</span></div>
    <div class="c">绝对定位</div>
    <div class="f">固定定位</div>
</body>

</html>